﻿<%@ Page Title="" Language="C#" MasterPageFile="~/BasicBase/BasicBase.master" AutoEventWireup="true"
    CodeFile="DeviceResult.aspx.cs" Inherits="BasicBase_DeviceResult" StylesheetTheme="Content" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">

    <script type="text/javascript">
        function OpenWin(url) {
            var h = 480;
            var w = 640;
            var t = (screen.height - h) / 2;
            var l = (screen.width - w) / 2;
            window.open(url, null, 'left=' + l + ",top=" + t + ",width=" + w + ",height=" + h + ",toolbar=yes,scrollbars=yes,status=yes");
        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:GridView ID="UserGrid" runat="server" AutoGenerateColumns="False" Caption="<span>装备器材列表</span>"
        DataKeyNames="DeviceID" OnRowDataBound="UserGrid_RowDataBound">
        <Columns>
            <%--<asp:TemplateField>
                <HeaderTemplate>
                    <input id="ChkAll" type="checkbox" onclick="CheckAll(this)" runat="server" title="全选/取消" />
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:CheckBox ID="CheckItem" runat="server" />
                </ItemTemplate>
                <HeaderStyle Width="20px" />
                <ItemStyle HorizontalAlign="Center" />
            </asp:TemplateField>--%>
            <asp:TemplateField>
                <ItemStyle HorizontalAlign="Center" />
                <HeaderStyle Width="30px" />
                <ItemTemplate>
                    <asp:Label ID="ID" runat="server"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="装备器材名称">
                <ItemTemplate>
                    <a href="javascript:OpenWin('DeviceView.aspx?DeviceID=<%# Eval("DeviceID") %>');">
                        <%# Eval("DeviceName") %></a>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="类型">
                <ItemTemplate>
                    <%# GetType(Eval("DeviceClass").ToString()) %>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="类别">
                <ItemTemplate>
                    <%# GetCodeItem(Eval("DeviceClass").ToString()) %>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="所属单位">
                <ItemTemplate>
                    <%# GetDepartmentName(Eval("DepartmentID").ToString())%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="数量">
                <ItemTemplate>
                    <%# Eval("DeviceCount")%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="状态">
                <ItemTemplate>
                    <%# GetCodeItem(Eval("State").ToString()) %>
                </ItemTemplate>
            </asp:TemplateField>
            
            <%-- <asp:TemplateField HeaderText="最后更新时间">
                <ItemTemplate>
                    <%# Eval("TimeLastModified") %>
                </ItemTemplate>
            </asp:TemplateField>--%>
        </Columns>
        <HeaderStyle HorizontalAlign="Left" />
    </asp:GridView>
    <div runat="server" id="footer" style="border:solid 1px #FEDBB5; text-align:right; padding-right:10px; color:Red; height:25px; background-color:#FFFCDC "></div>
    <div style="padding: 4px;">
        <div style="float: left">
            <asp:Label ID="lbGridInfo" runat="server"></asp:Label>
        </div>
        <div style="float: right">
            <asp:LinkButton ID="btnFirst" runat="server" CommandArgument="First" CommandName="Page"
                OnClick="btnFirst_Click">首页</asp:LinkButton>
            <asp:LinkButton ID="btnPrev" runat="server" CommandArgument="Prev" CommandName="Page"
                OnClick="btnPrev_Click">上一页</asp:LinkButton>
            <asp:LinkButton ID="btnNext" runat="server" CommandArgument="Next" CommandName="Page"
                OnClick="btnNext_Click">下一页</asp:LinkButton>
            <asp:LinkButton ID="btnLast" runat="server" CommandArgument="Last" CommandName="Page"
                OnClick="btnLast_Click">末页</asp:LinkButton>
            转到：第
            <asp:DropDownList ID="JumpList" runat="server" AutoPostBack="True" OnSelectedIndexChanged="JumpList_SelectedIndexChanged">
            </asp:DropDownList>
            页
        </div>
    </div>
</asp:Content>
